const firstFocusableSelector =
    'button:not([tabindex="-1"]), [href]:not([tabindex="-1"]), input:not([tabindex="-1"]), select:not([tabindex="-1"]), textarea:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"]), [focusable]:not([tabindex="-1"])';

// root:HTMLElement | ShadowRoot
// return: SpectrumElement | null

/**
 *
 * @param root {HTMLElement | ShadowRoot}
 * @returns {SpectrumElement | null}
 */
export const firstFocusableIn = (
    root
) => {
    return root.querySelector(
        firstFocusableSelector
    );
};
